home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / DTS Sample Code / Snippets / Platforms & Tools / MacApp / Windoid 1.0b2.2 / Windoid.r < prev    next >
Encoding:
Text File  |  1991-09-04  |  5.8 KB  |  241 lines  |  [TEXT/MPS ]

  1. // Copyright © 1991 by Apple Computer, Inc.  All rights reserved. 
  2. // Windoid.r file.
  3.  
  4. // INCLUDES ---------------------------------------------------------------------------------
  5. // Auto-Include the requirements for this source
  6.  
  7. #ifndef __TYPES.R__
  8. #include "Types.r"
  9. #endif
  10.  
  11. #ifndef __SYSTYPES.R__
  12. #include "SysTypes.r"                // needed for version resource
  13. #endif        
  14.  
  15. #ifndef __MacAppTypes__
  16. #include "MacAppTypes.r"
  17. #endif
  18.  
  19. #if qTemplateViews
  20. #ifndef __ViewTypes__
  21. #include "ViewTypes.r"
  22. #endif
  23. #endif
  24.  
  25. #if qDebug
  26. include "Debug.rsrc";
  27. #endif
  28.  
  29. #include "WindoidRez.h"                // common header file for resource IDs
  30.  
  31.  
  32. // RESOURCES -------------------------------------------------------------------------------
  33.  
  34. include "MacApp.rsrc";
  35. include "Printing.rsrc";
  36. include "FloatWindow.rsrc";            // floating window resources
  37.  
  38.  
  39. // CODE ------------------------------------------------------------------------------------
  40.  
  41. include $$Shell("ObjApp")"Windoid" 'CODE';
  42.  
  43.  
  44. // SIZE ------------------------------------------------------------------------------------
  45.  
  46. resource 'SIZE' (-1) {
  47.     saveScreen,
  48.     acceptSuspendResumeEvents,
  49.     enableOptionSwitch,
  50.     canBackground,
  51.     doesActivateOnFGSwitch,
  52.     backgroundAndForeground,
  53.     dontGetFrontClicks,
  54.     ignoreAppDiedEvents,
  55.     is32BitCompatible,
  56.     isHighLevelEventAware,
  57.     localAndRemoteHLEvents,
  58.     notStationeryAware,                
  59.     reserved,
  60.     reserved,
  61.     reserved,
  62.     reserved,
  63. #if qdebug
  64.     450 * 1024,
  65.     368 * 1024
  66. #else
  67.     300 * 1024,
  68.     200 * 1024
  69. #endif
  70. };
  71.  
  72.  
  73. // SEG! ------------------------------------------------------------------------------------
  74.  
  75. resource 'seg!' (256, purgeable) {
  76.     {
  77.         "GNonRes";
  78.         "GSelCommand";
  79.         "GTerminate";
  80.         "GClose";
  81.         "GDoCommand";
  82.     }
  83. };
  84.  
  85.  
  86. // VERS ------------------------------------------------------------------------------------
  87. // Get the default Version resources
  88.  
  89. include "Defaults.rsrc"  'vers' (1);                // application or file specific
  90. include "Defaults.rsrc"  'vers' (2);                // overall package
  91.  
  92.  
  93. // ALERTS AND DLOGS ------------------------------------------------------------------------
  94.  
  95. include "Defaults.rsrc" 'ALRT'    (phAboutApp);        // About… window
  96. include "Defaults.rsrc" 'DITL'    (phAboutApp);        // About… contents
  97. include "Defaults.rsrc" 'STR#'    (kDefaultCredits);    // credits
  98.  
  99.  
  100. // ICONs and BUNDLEs -----------------------------------------------------------------------
  101. // Get the default MacApp® application icon and file reference
  102.  
  103. include "Defaults.rsrc"  'ICN#' (128);
  104. include "Defaults.rsrc"  'FREF' (128);
  105.  
  106.  
  107. // CMNUs -----------------------------------------------------------------------------------
  108.  
  109. include "Defaults.rsrc" 'CMNU' (mApple);            // grab the default Apple/File menus
  110.  
  111. resource 'CMNU' (mFile,
  112. #if qNames
  113. "mFile",
  114. #endif
  115. nonpurgeable) {
  116.     mFile,
  117.     textMenuProc,
  118.     EnablingManagedByMacApp,
  119.     enabled,
  120.     "File",
  121.     {
  122.     "New",                noIcon, "N",    noMark, plain, cNew;
  123.     "Close",            noIcon, "W",    noMark, plain, cClose;
  124.     "-",                noIcon, noKey,    noMark, plain, nocommand;
  125.     "Quit",                noIcon, "Q",    noMark, plain, cQuit
  126.     }
  127. };
  128.  
  129.  
  130. resource 'CMNU' (mWindoid,
  131. #if qNames
  132. "mWindoid",
  133. #endif
  134. nonpurgeable) {
  135.     mWindoid,
  136.     textMenuProc,
  137.     EnablingManagedByMacApp,
  138.     enabled,
  139.     "Windoid",
  140.      {
  141.     "Green",            noIcon, noKey, noMark, plain, cGreen;
  142.     "Yellow",            noIcon, noKey, noMark, plain, cYellow;
  143.     "Red",                noIcon, noKey, noMark, plain, cRed;
  144.     }
  145. };
  146.  
  147. resource 'CMNU' (mNormalMenu,
  148. #if qNames
  149. "mNormalMenu",
  150. #endif
  151. nonpurgeable) {
  152.     mNormalMenu,
  153.     textMenuProc,
  154.     EnablingManagedByMacApp,
  155.     enabled,
  156.     "Set Light",
  157.      {
  158.     /* [1] */    "Green",                noIcon, "G", noMark, plain, cNormGreen;
  159.     /* [2] */    "Yellow",                noIcon, "Y", noMark, plain, cNormYellow;
  160.     /* [3] */    "Red",                    noIcon, "R", noMark, plain, cNormRed
  161.     }
  162. };
  163.  
  164.  
  165. // MBARs -----------------------------------------------------------------------------------
  166. // Displayed menus 
  167.  
  168. resource 'MBAR' (kMBarDisplayed,
  169. #if qNames
  170. "Windoid",
  171. #endif
  172.     purgeable) {
  173.     {mApple; mFile; mWindoid; mNormalMenu}
  174. };
  175.  
  176.  
  177. // VIEW RESOURCES NEEDED -------------------------------------------------------------------
  178.  
  179. #if qTemplateViews
  180.  
  181. // default big window ----------------------------------------------------------------------
  182.  
  183. resource 'view' (kDefaultWindowID,    
  184. #if qNames
  185. "kDefaultWindowID",
  186. #endif
  187.     purgeable) {
  188.     {
  189.         root, 'WIND', { 50, 20 }, { 200, 350 }, 
  190.         sizeVariable, sizeVariable, shown, enabled,
  191.         Window        { "", zoomDocProc, goAwayBox, 
  192.         Resizable, modeless,ignoreFirstClick,
  193.         freeOnClosing, disposeOnFree, closesDocument, 
  194.         openWithDocument, dontAdaptToScreen, stagger, 
  195.         forceOnScreen, dontCenter, 'DFLT', "" };
  196.  
  197.         'WIND', 'SCLR',    { 0, 0 }, { 200-kSBarSizeMinus1, 350-kSBarSizeMinus1 },
  198.         sizeRelSuperView, sizeRelSuperView, shown, enabled,
  199.         Scroller    { "", vertScrollBar, horzScrollBar, 0, 0, 16, 16,
  200.                     vertConstrain, horzConstrain, { 0, 0, 0, 0 } };
  201.  
  202.         'SCLR',IncludeViews    { kDefaultViewID }
  203.     }
  204. };
  205.  
  206.  
  207. // default view inside default window ------------------------------------------------------
  208.  
  209. resource 'view' (kDefaultViewID,                    
  210. #if qNames
  211. "kDefaultViewID",
  212. #endif
  213.     purgeable) {
  214.     {
  215.         root, 'DFLT', { 0, 0 }, { 150, 320}, sizeFixed, sizeFixed, shown, enabled,
  216.         DefaultView        {""}                // A ClassName can be put in this string
  217.                                             // or do a RegisterStdType to point to
  218.                                             // something to create for a "Default View"
  219.     }
  220. };
  221.  
  222.  
  223. // light palette view ----------------------------------------------------------------------
  224.  
  225.  
  226. resource 'view' (kLightPaletteRSRCID, purgeable) { {
  227.     root, 'TWND', { 80, 80 }, { kLightPaletteHeight, kLightPaletteWidth }, sizeFixed, sizeFixed, shown, enabled,
  228.     Window {
  229.         "TFloatWindow",
  230.             kWindoidWDEF + kWindoidNotResizable, goAwayBox, notResizable, 
  231.             modeless, ignoreFirstClick, dontfreeOnClosing,
  232.             dontdisposeOnFree, doesntCloseDocument, dontOpenWithDocument, 
  233.             dontAdaptToScreen, dontStagger,
  234.             forceOnScreen, dontCenter, noid, "" };
  235.  
  236.     'TWND', 'TPLT', { 0, 0 }, { kLightPaletteHeight, kLightPaletteWidth }, sizeFixed, sizeFixed, shown, enabled,
  237.     view { "TLightPalette" };
  238. } };
  239.  
  240.  
  241. #endif